package code.main.modle.hall
{
	import code.main.view.hall.HallItemVo;
	import code.phpnet.Remoting;

	/**
	 *大厅数据模型 
	 * @author YY
	 * 
	 */
	public class HallData
	{
		private var _list:Array;
		private var _reqCB:Function;
		public function HallData()
		{
		}
		public function reqData(cb:Function):void {
			_reqCB = cb;
			Remoting.getInstance().nuTables.getAllTables(reqCB, 0,1);
		}
		
		private function reqCB(arr:Array):void {
			if(arr) {
				var i:int;
				var vo:HallItemVo;
				var type:int = arr.shift();
				var len:int = arr.length;
				_list = [];
				var tempArr:Array;
				for(i=0; i<len; i++) {
					tempArr = arr[i];
					vo = new HallItemVo();
					vo.tableId = tempArr[0];
					vo.serverId = tempArr[1];
					vo.tableName = tempArr[2];
					vo.watchNumb = tempArr[3];
					vo.matchNumb = tempArr[4];
					vo.watchNumb = tempArr[5];
					vo.minBet = tempArr[6];
					vo.minBuyIn = tempArr[7];
					vo.maxBuyIn = tempArr[8];
					_list.push(vo);
				}
			}
			if(Boolean(_reqCB)) {
				_reqCB();
			}
		}

		public function get list():Array
		{
			return _list;
		}

		public function set list(value:Array):void
		{
			_list = value;
		}

	}
}